//
//  DiscoveryViewController.m
//  Futures
//
//  Created by Cheng on 2017/6/20.
//  Copyright © 2017年 Cheng. All rights reserved.
//

#import "DiscoveryViewController.h"
#import "DiscoveryCell.h"
#define kDiscoveryCellID @"kDiscoveryCellID"
@interface DiscoveryViewController () <UITableViewDelegate,UITableViewDataSource>{
    NSArray *_imageArray;
    NSArray *_titleArray;
    NSArray *_detailArray;
}

@end

@implementation DiscoveryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"发现";
    
    _imageArray = @[@"notification",@"task",@"discovery_customer",@"makemoney"];
    _titleArray = @[@"重要通知",@"任务中心",@"客服中心",@"推广赚钱"];
    _detailArray = @[@"公告通知 敬请知悉",@"动动手指做任务",@"贴心专业周到",@"0成本 轻松赚"];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return _titleArray.count;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 85;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    DiscoveryCell *cell = [tableView dequeueReusableCellWithIdentifier:kDiscoveryCellID forIndexPath:indexPath];
    
    cell.iconImageView.image = LoadImage(_imageArray[indexPath.row]);
    cell.titleLable.text = _titleArray[indexPath.row];
    cell.detailLabel.text = _detailArray[indexPath.row];
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}



@end
